home *** CD-ROM | disk | FTP | other *** search
- Path: dispatch.news.demon.net!demon!alma.ipso.net
- From: martin@ipso.net (Martin Barry)
- Newsgroups: comp.lang.c++
- Subject: Re: question in c++
- Date: Sat, 20 Apr 1996 13:13:26 GMT
- Message-ID: <3178e02c.167686891@news.ipso.net>
- References: <4l9gs9$4jp@ustsu10.ust.hk>
- Reply-To: martin@ipso.net
- NNTP-Posting-Host: alma.ipso.net
- X-NNTP-Posting-Host: alma.ipso.net
- X-Newsreader: Forte Agent .99e/32.201
-
- hello all
-
- i'm new to this newsgroup, and i'm a bit rusty - in fact i am
- re-learning C++ right now; however, i thought i'd look at this...
-
- ec_wsk@uxmail.ust.hk (Wong Siu Ki) wrote:
-
- : It won't execute the cin in the while loop, how can I solve it?
- how do you mean?
- will it compile?
- in little problems like this, i would add the lines as follows
- :
- : #include <iostream.h>
- : #include <stdio.h>
- #define test 0
- :
- : void main()
- : {
- : int x; //initialise x? will the array make sense other wise?
- x=0;
- : char command;
- : int data[500];
- : int temp;
- : while (scanf("%d", &temp)!=EOF)
- : {
- : x++;
- : data[x]=temp;
- : }
- :
- : while (command!='e')
- : {
- : cout << "Enter command:";
- if (test=0)
- cout << "here1";
- : cin >> command;
- if (test=0)
- cout << "here2";
- : cout << "test" << endl;
- : }
- :
- : }
-
- it will at least help in the future - when you've got mega large
- programs, you can't go putting in test statements and then deleting
- them......
-
- i guess anything helps...
-
- llp
-
-
- baz
-
-
-